package com.demo.mystudy.ui.downloadfile

import android.content.Context
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.databinding.DataBindingUtil
import androidx.fragment.app.FragmentManager
import com.demo.mystudy.R
import com.demo.mystudy.databinding.DialogDownloadfileBinding
import com.demo.mystudy.databinding.DialogEditfileBinding
import com.demo.mystudy.ui.socketserver.SocketDF
import com.jetinno.simple.SimpleDialogFragment
import com.jetinno.simple.utils.FragmentsUtil

class DownloadFileDF:SimpleDialogFragment() {
    lateinit var mDB:DialogDownloadfileBinding
    override fun useDatabing(inflater: LayoutInflater, container: ViewGroup?): View? {
        mDB= DataBindingUtil.inflate(inflater,getLayoutId() , container, false)
        return mDB.root
    }
    private val filePath:String by lazy { requireArguments().getString("data")!! }
    override fun getLayoutId(): Int {
        return R.layout.dialog_downloadfile
    }

    override fun initView() {
    }

    override fun initEvent() {
    }

    override fun initData() {
    }

    companion object {
        fun showDownloadFileDF(fragmentManager: FragmentManager, context: Context,filePath:String) {
            val bundle = Bundle()
            bundle.putString("data", filePath)
            FragmentsUtil.showDialog(fragmentManager, context, DownloadFileDF::class.java,bundle)
        }
    }
}